﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Brushes.xaml" />
        <ResourceDictionary Source="Fonts.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <Style x:Key="DefaultFrameworkElementStyle" TargetType="FrameworkElement">
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="Margin" Value="2,1" />
        <Setter Property="Height" Value="23" />
    </Style>

    <Style x:Key="DefaultControlStyle" TargetType="Control" BasedOn="{StaticResource DefaultFrameworkElementStyle}">
        <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
        <Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
        <Setter Property="Foreground" Value="{StaticResource DefaultFontColour}" />
    </Style>

    <Style x:Key="DefaultContentControlStyle" TargetType="ContentControl" BasedOn="{StaticResource DefaultControlStyle}">
        <Setter Property="VerticalContentAlignment" Value="Center" />
    </Style>

    <Style x:Key="DefaultCheckboxStyle" TargetType="CheckBox" BasedOn="{StaticResource DefaultContentControlStyle}">

    </Style>

    <Style x:Key="DefaultRadioButtonStyle" TargetType="RadioButton" BasedOn="{StaticResource DefaultContentControlStyle}">

    </Style>

    <Style x:Key="DefaultLabelStyle" TargetType="Label" BasedOn="{StaticResource DefaultContentControlStyle}">
        <Setter Property="BorderBrush" Value="Transparent" />
        <Setter Property="BorderThickness" Value="0.5,0" />
    </Style>

    <Style x:Key="DefaultTextBlockStyle" TargetType="TextBlock" BasedOn="{StaticResource DefaultFrameworkElementStyle}">
        <!-- START : Should be exactly same as: DefaultControlStyle -->
        <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
        <Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
        <Setter Property="Foreground" Value="{StaticResource DefaultFontColour}" />
        <!-- END : Should be same as: DefaultControlStyle -->

        <!-- REST -->
    </Style>

    <Style x:Key="DefaultGroupBoxStyle" TargetType="GroupBox">
        <!--BasedOn="{StaticResource DefaultControlStyle}"-->

        <Setter Property="BorderBrush" Value="{StaticResource DefaultFontColour}" />
        <Setter Property="BorderThickness" Value="1" />
    </Style>

    <Style x:Key="DefaultTextBoxStyle" TargetType="TextBox" BasedOn="{StaticResource DefaultFrameworkElementStyle}">
        <!-- START : Should be exactly same as: DefaultControlStyle -->
        <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
        <Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
        <Setter Property="Foreground" Value="{StaticResource DefaultFontColour}" />
        <!-- END : Should be same as: DefaultControlStyle -->

        <!-- REST -->
        <Setter Property="VerticalAlignment" Value="Center" />
    </Style>

    <Style x:Key="DefaultButtonStyle" TargetType="Button" BasedOn="{StaticResource DefaultContentControlStyle}">
        <Setter Property="HorizontalAlignment" Value="Center" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="Padding" Value="5,2" />
    </Style>

    <Style x:Key="DefaultDGHeaderStyle" TargetType="DataGridColumnHeader" BasedOn="{StaticResource DefaultControlStyle}">
        <Setter Property="BorderBrush" Value="White" />
        <Setter Property="BorderThickness" Value="0.5,0" />
        <!--<Setter Property="Background" Value="Green" />-->
        <!--<Setter Property="Foreground" Value="White" />-->
        <Setter Property="FontWeight" Value="Bold" />
        <Setter Property="Padding" Value="5,1" />
        <!--<Setter Property="Style">
            <Setter.Value>
                <Style TargetType="DataGridColumnHeader">
                    
                </Style>
            </Setter.Value>
        </Setter>-->

        <!--Aegis-->
        <!--<Setter Property="Foreground" Value="{StaticResource TextBrush}"/>-->
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="Height" Value="30" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Padding" Value="1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="DataGridColumnHeader">
                    <Grid x:Name="Root">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="MouseOverBorder" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="1.0" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PressedBorder" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="1.0" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="SortStates">
                                <VisualState x:Name="Unsorted" />
                                <VisualState x:Name="SortAscending">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1.0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="SortIcon" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="SortDescending">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1.0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="SortIcon" />
                                        <DoubleAnimation Duration="0" To="-.9" Storyboard.TargetProperty="(RenderTransform).ScaleY" Storyboard.TargetName="SortIcon" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="BackgroundBorder" Grid.ColumnSpan="2" Background="{StaticResource DataGridColumnHeaderBrush}" BorderThickness="0,1,0,0" BorderBrush="{StaticResource DataGridColumnHeaderBorderBrush}" />
                        <Border x:Name="MouseOverBorder" BorderBrush="#FFE3E8EE" BorderThickness="1" Opacity="0">
                            <Border BorderBrush="White" BorderThickness="1">
                                <Border.Background>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FFF3F8FD" Offset="0" />
                                        <GradientStop Color="#FFEFF3F9" Offset="1" />
                                        <GradientStop Color="#FFF2F7FC" Offset="0.215" />
                                    </LinearGradientBrush>
                                </Border.Background>
                            </Border>
                        </Border>
                        <Border x:Name="PressedBorder" BorderBrush="#FFC1CCDA" BorderThickness="1" Opacity="0">
                            <Border BorderBrush="#FFD7DEE7" BorderThickness="0,1,0,0">
                                <Border BorderBrush="#FFEBEEF2" BorderThickness="0,1,0,0" />
                            </Border>
                        </Border>
                        <Grid Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition />
                            </Grid.RowDefinitions>
                            <Path x:Name="SortIcon" Data="F1 M -5.215,6.099L 5.215,6.099L 0,0L -5.215,6.099 Z " HorizontalAlignment="Center" Margin="4,2,0,0" RenderTransformOrigin=".5,.5" Stretch="Uniform" VerticalAlignment="Center" Width="8" Opacity="0">
                                <Path.Fill>
                                    <LinearGradientBrush EndPoint="0.812,0.5" StartPoint="0.188,0.5">
                                        <GradientStop Color="#FF3C596C" Offset="0" />
                                        <GradientStop Color="#FFC4E3F4" Offset="1" />
                                    </LinearGradientBrush>
                                </Path.Fill>
                                <Path.RenderTransform>
                                    <ScaleTransform ScaleY=".9" ScaleX=".9" />
                                </Path.RenderTransform>
                            </Path>
                            <ContentPresenter Grid.Row="1" Content="{TemplateBinding Content}" HorizontalAlignment="Left" Margin="4,2" />
                        </Grid>
                        <Rectangle x:Name="VerticalSeparator" Grid.Column="1" Visibility="{TemplateBinding SeparatorVisibility}" VerticalAlignment="Stretch" Width="1">
                            <Rectangle.Fill>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="#FFDFEAF7" Offset="0" />
                                    <GradientStop Color="Transparent" Offset="1" />
                                    <GradientStop Color="#FFE4EDF7" Offset="0.526" />
                                </LinearGradientBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="DefaultDGCellStyle" TargetType="DataGridCell" BasedOn="{StaticResource DefaultControlStyle}">
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Foreground" Value="Red" />
    </Style>

    <!--<Style x:Key="DefaultDGTemplateColumnStyle" TargetType="DataGridTemplateColumn" BasedOn="{StaticResource DefaultControlStyle}">
        <Setter Property="CellTemplate">
            <Setter.Value>
                <TextBlock Text="abc" />
            </Setter.Value>
        </Setter>
    </Style>-->

    <Style x:Key="DefaultDGStyle" TargetType="DataGrid">
        <Setter Property="CanUserAddRows" Value="False" />
        <Setter Property="CanUserDeleteRows" Value="False" />
        <Setter Property="CanUserReorderColumns" Value="True" />
        <Setter Property="CanUserResizeColumns" Value="True" />
        <Setter Property="CanUserSortColumns" Value="True" />
        <Setter Property="AlternationCount" Value="1" />
        <Setter Property="AlternatingRowBackground" Value="#FFE0D7EA" />
    </Style>

    <!--Implicit declarations for default styles on controls-->
    <Style TargetType="FrameworkElement" BasedOn="{StaticResource DefaultFrameworkElementStyle}" />
    <Style TargetType="Control" BasedOn="{StaticResource DefaultControlStyle}" />
    <Style TargetType="ContentControl" BasedOn="{StaticResource DefaultContentControlStyle}" />
    <Style TargetType="CheckBox" BasedOn="{StaticResource DefaultCheckboxStyle}" />
    <Style TargetType="RadioButton" BasedOn="{StaticResource DefaultRadioButtonStyle}" />
    <Style TargetType="Label" BasedOn="{StaticResource DefaultLabelStyle}" />
    <!--<Style TargetType="TextBlock" BasedOn="{StaticResource DefaultTextBlockStyle}" />-->
    <Style TargetType="TextBox" BasedOn="{StaticResource DefaultTextBoxStyle}" />
    <Style TargetType="Button" BasedOn="{StaticResource DefaultButtonStyle}" />
    <Style TargetType="DataGrid" BasedOn="{StaticResource DefaultDGStyle}" />
    <Style TargetType="DataGridColumnHeader" BasedOn="{StaticResource DefaultDGHeaderStyle}" />
    <Style TargetType="DataGridCell" BasedOn="{StaticResource DefaultDGCellStyle}" />
    <Style TargetType="GroupBox" BasedOn="{StaticResource DefaultGroupBoxStyle}" />
    <!--<Style TargetType="DataGridTemplateColumn" BasedOn="{StaticResource DefaultDGTemplateColumnStyle}" />-->

</ResourceDictionary>
 